﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace Soapi.Notify2.Lib
{
    public class UserSettings : ApplicationSettingsBase
    {
        [UserScopedSetting()]
        [SettingsSerializeAs(SettingsSerializeAs.Xml)]
        [DefaultSettingValue("")]
        public bool UseGrowl
        {
            get
            {
                if (this["useGrowl"] == null)
                {
                    this["useGrowl"] = false;
                }
                return (bool)this["useGrowl"];
            }
            set
            {
                this["useGrowl"] = value;
            }
        }
        [UserScopedSetting()]
        [SettingsSerializeAs(SettingsSerializeAs.Xml)]
        [DefaultSettingValue("")]
        public bool UpdatePinned
        {
            get
            {
                if (this["updatePinned"] == null)
                {
                    this["updatePinned"] = false;
                }
                return (bool)this["updatePinned"];
            }
            set
            {
                this["updatePinned"] = value;
            }
        }

        [UserScopedSetting()]
        [SettingsSerializeAs(SettingsSerializeAs.Binary)]
        [DefaultSettingValue("")]
        public SiteList Sites
        {
            get
            {
                if (this["sites"] == null)
                {
                    this["sites"] = new SiteList();
                }
                return (SiteList)this["sites"];
            }
            set
            {
                this["sites"] = value;
            }
        }
        [UserScopedSetting()]
        [SettingsSerializeAs(SettingsSerializeAs.Xml)]
        [DefaultSettingValue("")]
        public int PollingInterval
        {
            get
            {
                if (this["pollingInterval"] == null)
                {
                    this["pollingInterval"] = 60;
                }
                return (int)this["pollingInterval"];
            }
            set
            {
                this["pollingInterval"] = value;
            }
        }
    }
}
